/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Programas_En_Clase;

import java.util.Scanner;

/**
 *
 * @author gurrola
 */
public class Posicion {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
          String  str; 
          int  i; 
          int k=0;  
          int  b;  

        System.out.println("Introduce un numero coma y una letra");

        String cad = sc.next();
        String [] cad2=cad.split("-");

        for(int x=1;x<cad2.length;x+=2){
           i=Integer.parseInt(cad2[x]);
           if(i>k){
                k=i;
           }
        }

         String cad3[] = new String[k];
         for(int z=0; z<cad2.length;z+=2){

            str=cad2[z+1];
            b=Integer.parseInt(str);
            cad3[b-1]=cad2[k];
        }

         for(int y=0; y<cad3.length;y++){

             if(cad3[y]==null){
                cad3[y]=" ";
             }
             System.out.print("|"+cad3[y]);

         }
    }

}
